using SmartLink.Domain.Entity;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SmartLink.EnumLibrary;
using SmartLink.Domain.ExpandEntity;

namespace SmartLink.IRepository
{
    public interface ISYS_ModuleRepo : IRepository<SYS_Module>
    {
        /// <summary>
        /// 判断模块编码是否已存在
        /// </summary>
        /// <param name="code"></param>
        /// <returns></returns>
        bool Exist(string code);
        /// <summary>
        /// 判断修改后的模块编码是否重复
        /// </summary>
        /// <param name="id"></param>
        /// <param name="newCode"></param>
        /// <returns></returns>
        bool Repeat(int id, string newCode);
        /// <summary>
        /// 获取指定父级下的直系子模块
        /// </summary>
        /// <param name="parentId"></param>
        /// <returns></returns>
        IEnumerable<SYS_Module> GetImmediateChildren(int parentId);
        /// <summary>
        /// 获取授权给指定对象的功能模块
        /// </summary>
        /// <param name="ownerType"></param>
        /// <param name="ownerIds"></param>
        /// <returns></returns>
        IEnumerable<SYS_Module> GetAuthorizedModules(AuthorizationOwnerTypeEnum ownerType, params int[] ownerIds);
        /// <summary>
        /// 判断模块是否存在直接子节点
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        bool ExistChildren(int id);
        /// <summary>
        /// 获取所有系统模块，带关联关系
        /// </summary>
        /// <param name="containsLogicDeleted"></param>
        /// <returns></returns>
        IEnumerable<SysModuleExpand> GetAllWithRelation(bool containsLogicDeleted);
        /// <summary>
        /// 获取公司管理员拥有的系统模块
        /// </summary>
        /// <returns></returns>
        IEnumerable<SYS_Module> GetOrgManagerModules();
    }
}
